/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from "@/utils/request";

// 调度列表
export async function getList(params) {
  return request("/Api/Handle/run", {
    method: "POST",
    body: {
      data: JSON.stringify({
        run: "/Order/orderForm",
        time: new Date().getTime(),
        data: params
      })
    }
  });
}

// 调度统计
export async function getCount(params) {
  return request("/Api/Handle/run", {
    method: "POST",
    body: {
      data: JSON.stringify({
        run: "/Order/stat",
        time: new Date().getTime(),
        data: params
      })
    }
  });
}

// 获取接单快递员
export async function getCourier(params) {
  return request("/Api/Handle/run", {
    method: "POST",
    body: {
      data: JSON.stringify({
        run: "/Order/courierLeftList",
        time: new Date().getTime(),
        data: params
      })
    }
  });
}

// 分配快递员
export async function assignTo(params) {
  return request("/Api/Handle/run", {
    method: "POST",
    body: {
      data: JSON.stringify({
        run: "/Order/orderAccept",
        time: new Date().getTime(),
        data: params
      })
    }
  });
}

// 取消分配
export async function cancelOrder(params) {
  return request("/Api/Handle/run", {
    method: "POST",
    body: {
      data: JSON.stringify({
        run: "/Order/orderCancel",
        time: new Date().getTime(),
        data: params
      })
    }
  });
}
